Skip to content
本页内容

CustomProperty (对象)

代表标识符信息。标识符信息可用于 XML 的元数据。

说明

使用 Add 方法或 CustomProperties 集合的 Item 属性可返回 CustomProperty 对象。

返回 CustomProperty 对象后,可在 Add 方法中使用 CustomProperties 属性向工作表中添加元数据。

在本示例中,ET 向活动工作表添加标识符信息,并向用户返回名称和值。

python
def test():
    wksSheet1 = Application.ActiveSheet

    # Add metadata to worksheet.
    wksSheet1.CustomProperties.Add("Market", "Nasdaq")

    # Display metadata.
    cusProperties = wksSheet1.CustomProperties.Item(1)
    print(cusProperties.Name + "\t" + cusProperties.Value)